package me.fung.rem.app.main.version

import me.fung.rem.bean.repo.*
import org.ktorm.database.Database
import java.sql.Connection

class VersionUpdater1p2 : VersionUpdater() {
    override val targetVersion: Float = 1.2f
    override fun updateSql(db: Database, connection: Connection) {
        // TagInfo ==============================================================
        """
            CREATE table TagInfo(
            id integer primary key autoincrement,
            text varchar(255)
            );
        """.trimIndent().createStatementAndExecute(connection)
        // 初始化数据
        listOf(
            "学习", "编程", "游戏", "邮箱", "管理", "网盘", "社交", "音乐", "视频", "图片", "文档", "其他"
        ).forEach {
            TagInfo(0, it).add()
        }
    }
}
